<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>基础数据设置</title> 
<%@ include file="/page/include.jsp"%>
</head>
<body class="nav-md">
    <div class="container body">
        <div class="main_container">
            <div class="framebody" role="main">
                <div class="row">
                    <!-- 左单 begin -->
                    <div class="col-md-3 col-sm-3 col-xs-3">
                        <div class="x_panel" style="height: 90%;">
                            <div class="x_title">
                                <h2>
                                    <i class="fa fa-reorder fa-fw"></i>字典数据 <small></small>
                                </h2>
                                <div class="clearfix">
                                    <div class="pull-right">
                                        <a class="btn btn-success" id="btnAddDict">添加</a>
                                    </div>
                                </div>
                            </div>
                            <div class="x_content">
                                <div class="row">
                                    <div style="height:450px;overflow:auto;margin-left:-10px;margin-right:-10px;">
                                        <table id="dictTable" class="table"></table>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- 左单 end -->
                    <!-- 内容表格 begin -->
                    <div class="col-md-9 col-sm-9 col-xs-9">
                        <div class="x_panel">
                            <div class="x_title">
                                <h2>
                                    <i class="fa fa-reorder fa-fw"></i>字典数据设置 <small></small>
                                </h2>
                                <div class="clearfix">
                                    <div class="pull-right">
                                        <a class="btn btn-success" id="btnAdd">添加</a>
                                    </div>
                                </div>
                            </div>
                            <div class="x_content">
                                <div class="row">
                                    <table id="keymapTable" class="table"></table>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- 内容表格 end -->
                </div>
            </div>
        </div>
    </div>
    
    <input id="id" type="hidden" />
    <input id="keyType" type="hidden" />
    
    <!-- 字典添加弹出层 begin -->
    <div class="modal fade" id="dictModal" tabindex="-1" role="dialog" aria-labelledby="dictModalLabel" aria-hidden="true">
        <div class="modal-dialog" style="width: 40%;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="dictModalLabel">添加字典</h4>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal form-label-left">
                        <div class="item form-group">
                            <label class="control-label col-md-3" for="dictName"><span class="required"><font color="red">*</font>字典中文名: </span>
                            </label>
                            <div class="col-md-9">
                              <input id="dictName" name="dictName" class="form-control col-md-12"  type="text" placeholder="请输入字典中文名。如：订单类型、商品状态 ... ...">
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-3" for="dictType"><span class="required"><font color="red">*</font>字典名称: </span>
                            </label>
                            <div class="col-md-9">
                              <input id="dictType" name="dictType" class="form-control col-md-12"  type="text" placeholder="请输入字典名称。如：orderType、productStatus ... ...">
                              <input id="type" name="type" type="hidden" value="1">
                            </div>
                        </div>
                        <div class="item form-group" id="divType">
                            <label class="control-label col-md-3" for="dictType"><span class="required"><font color="red">*</font>类型: </span>
                            </label>
                            <div class="col-md-9">
								<select class="form-control col-md-12" id="typeCombo" name="typeCombo" onchange="javascript: $('#type').val($(this).val());">
									<option value="1">系统字典(不可修改)</option>
									<option value="2">运营字典(可以修改)</option>
								</select>
							</div>
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary" onclick="javascript: doSaveDict();">确认保存</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>
    <!-- 字典添加弹出层 end -->
    
    <!-- 基础数据添加弹出层 begin -->
    <div class="modal fade" id="keyModal" tabindex="-1" role="dialog" aria-labelledby="keyModalLabel" aria-hidden="true">
        <div class="modal-dialog" style="width: 60%;">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="keyModalLabel">添加字典数据</h4>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal form-label-left">
                        <div class="item form-group">
                            <label class="control-label col-md-3" for="keyIntro"><span class="required"><font color="red">*</font>字典项名称: </span>
                            </label>
                            <div class="col-md-9">
                              <input id="keyIntro" name="keyIntro" class="form-control col-md-12"  type="text" placeholder="通常为中文名称。如：上架、预售、售罄、下架 ... ...">
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-3" for="keyValue"><span class="required"><font color="red">*</font>字典项值: </span>
                            </label>
                            <div class="col-md-9">
                              <input id="keyValue" name="keyValue" class="form-control col-md-12 col-xs-12"  type="text" placeholder="通常为数字标识，且不可重复。如：01、02、03、04 ... ...">
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-3" for="sortMark"><span class="required">排序号（升序）: </span>
                            </label>
                            <div class="col-md-9">
                              <input id="sortMark" name="sortMark" maxlength="20" onkeyup="this.value=this.value.replace(/\D/g,'')" class="form-control col-md-12 col-xs-12"  
                                  type="text" placeholder="升序排列，只能输入数字，如：1、2、3 ...">
                            </div>
                        </div>
                        <div class="item form-group">
                            <label class="control-label col-md-3" for="intro"><span class="required">备注: </span>
                            </label>
                            <div class="col-md-9">
                              <textarea id="intro" name="intro" class="form-control col-md-12 col-xs-12" placeholder="字典项描述"></textarea>
                            </div>
                        </div>
                        
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" class="btn btn-primary" onclick="javascript: doSaveKeymap();">确认保存</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>
    <!-- 基础数据添加弹出层 end -->
    
</body>
<script type="text/javascript"
    src="${rootPath }/js/settings/keymap_list.js"></script>
</html>